package com.wp._2016校招.网易;

import java.util.Scanner;
import java.util.Stack;

public class 魔法棒 {
    public static void main(String[] args) {
        Stack stack = new Stack();
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int number = in.nextInt();
            while (number != 0) {
                if ((number & 1) == 1) {
                    number = (number - 1) / 2;
                    stack.add("1");
                } else {
                    number = (number - 2) / 2;
                    stack.add("2");
                }
            }
            String result = new String("");
            while (!stack.isEmpty()) {
                result += stack.pop();
            }
            System.out.println(result);
        }
    }
}